package com.nineclock.document.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.document.pojo.DocFile;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DocFileMapper extends BaseMapper<DocFile> {

    @Select("select * from doc_file where folder_id = #{parentFolderId} and `status` = 1 " +
            "and id in (select file_id from doc_collaborations where collaboration_id = #{companyUserId})")
    public List<DocFile> selectFileListByCollaboration(@Param("parentFolderId") Long parentFolderId,
                                                       @Param("companyUserId") Long companyUserId);
}
